home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Newbie: Character values?
- Date: Mon, 08 Apr 1996 15:26:21 -0400
- Organization: Datalytics, Inc
- Message-ID: <3169685D.22DB@datalytics.com>
- References: <4k7ute$oud@freenet-news.carleton.ca> <4k8cor$oca@grimsel.zurich.ibm.com>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Keith Whittingham wrote:
- >
- > In <4k7ute$oud@freenet-news.carleton.ca>, am573@FreeNet.Carleton.CA (Jason Olenick) writes:
- > >
- > >I am trying to see if the user has typed the Insert or Delete key in a
- > >program I wrote...but the unsinged char is giving the values of 0 then 82
- > >for insert (same as R) and delete is 0 then 83 (same as S). So what I'm
- > >doing then is seeing if the chars value is 0 if it was then see if the
- > >next chars value is 82 or 83. Is there an easier way around this? Not
- > >that this is hard, it just doesn't seem right.
- > >
- >
- > You're doing the right (simplest) thing.
- >
-
- What you're seeing is a zero used as an escape character. It
- indicates that the next code is that for a special
- character/key.
-
- Do note that the codes you're getting are platform/OS specific.
- The only way to make such code portable would be to create a
- library function that handles OS-specific translation into some
- library-specific representation. You could then write your
- programs to the library function and its character encoding,
- linking with the correct version of the library for the target
- platform.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-